#include "StdAfx.h"
#include "MyUIModule.h"
#include "DlgItemUI.h"


//////////////////////////////////////////////////////////////////////////
//
//////////////////////////////////////////////////////////////////////////
CMyUIModule::CMyUIModule(IUIIoModule* pIService)
{
	m_pIService = pIService;
	m_pDlgItem = NULL;
}


CMyUIModule::~CMyUIModule(void)
{

}

void* CMyUIModule::CreateItemWnd(IUIIoEdit* pUIEditor,int nFlag,int& nWidth,int& nHeight,void* pParentWnd)
{
	m_pDlgItem = new CDlgItemUI(pUIEditor->GetIoLinker(),(CWnd*)pParentWnd);
	m_pDlgItem->Create(IDD_ITEMUI,(CWnd*)pParentWnd);
	m_pDlgItem->ShowWindow(SW_SHOW);
	nWidth = m_pDlgItem->m_rcClient.Width();
	nHeight = m_pDlgItem->m_rcClient.Height();
	//lpCtrlObj = m_pMainWnd->GetIDispatch(TRUE);
	//pSonWnd   = m_pMainWnd;
	return m_pDlgItem;
}

void CMyUIModule::DeleteItemWnd(void* pItemWnd)
{
	if(pItemWnd == NULL)
		return ;
	delete (CDlgItemUI*)pItemWnd;
	m_pDlgItem = NULL;
}

void CMyUIModule::OnItemWndActive()
{

}

void CMyUIModule::OnItemWndApply()
{
	if(m_pDlgItem == NULL)
		return ;
	m_pDlgItem->OnApply();
}


